package implementation.server;

import java.lang.reflect.Array;
import java.util.ArrayList;


public interface IDB {
	
	// TODO: add getThreads(forumID) getPosts(threadID)
	
	/**
	 * 
	 * @return new user_id or user_id < 0 if something fails
	 */
	int addUser(String username, String password);
	
	IReadOnlyUser getUser(int userId);
	
	boolean follow(int followerID, int followedID);
	
	boolean stopFollowing(int userID, int friendID);
	
	/**
	 * 
	 * @param forumName
	 * @return new forumID or forumID < 0 if something fails
	 */
	int addForum(String forumName);
	
	/**
	 * 
	 * @param forumName
	 * @return new threadID or threadID < 0 if something fails
	 */
	int addThread(int forumId, String threadTopic, String threadContent, int authorID);
	
	/**
	 * 
	 * @param forumName
	 * @return new postID or postID < 0 if something fails
	 * 
	 * 
	 * 
	 */
	int addPost(int threadID, String postTopic, String postcontent, int authorID);
	
	/**
	 * 
	 * @param forumId
	 * @return true if the forum deleted or false if something failed
	 * 
	 * 
	 * 
	 */
	boolean removeForum(int forumId);
	
	/**
	 * 
	 * @param threadId
	 * @return true if the thread deleted or false if something failed
	 * 
	 * 
	 * 
	 */
	boolean removeThread(int threadId);
	
	/**
	 * 
	 * @param postId
	 * @return true if the post deleted or false if something failed
	 * 
	 * 
	 * 
	 */
	boolean removePost(int postId);
	
	IReadOnlyForum getForum(int forumID);
	
	ArrayList<IReadOnlyForum> getForums();
	
	IReadOnlyThread getThread(int threadID);
	
	IReadOnlyPost getPost(int postID);
	
	int getUserID(String username);
	
	boolean editPost(int postID, String topic, String content);
	
}
